package com.cll.prototype.user.controller.service.captcha;

import com.cll.prototype.common.dto.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * 描述信息:
 * 调用验证码微服务的服务降级方法
 * @author CLL
 * @version 1.0
 * @date 2020/10/30 17:32
 */
@Component
@Qualifier("authCaptchaControllerFeignClientFallback")
public class AuthCaptchaControllerFeignClientFallback implements AuthCaptchaControllerFeignClient {

    private static final Logger logger = LoggerFactory.getLogger(AuthCaptchaControllerFeignClientFallback.class);

    @Override
    public AjaxResult createRegisterCaptcha(String email) {
        logger.error("****** 调用验证码微服务获取注册验证码失败，进行服务降级");
        return AjaxResult.success(24, "获取注册验证码服务降级", -6);
    }

    @Override
    public AjaxResult checkCaptcha(String email, String captcha) {
        logger.error("****** 校验注册验证码是否正确失败，进行服务降级");
        return AjaxResult.success(24, "校验验证码服务降级", -6);
    }
}
